fix: take the pull request SHAs from the event payload - #153
Merged
Conversation
The JSON pulls.get call was used only to obtain the base/head SHAs for the uncapped compare request, but on GHES 3.18 it fails with 422 "The request could not be processed because too many files changed" when the workflow's GITHUB_TOKEN queries a sufficiently large pull request (a PAT querying the same pull request succeeds). The SHAs are already present in the pull_request event payload, which is guaranteed to exist on every path that reaches getPrDiff, so use them instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bugale
force-pushed
the
bugale/pr-shas-from-payload
branch
from
August 21, 2026 17:47
7694d4a to
074b1ff
Compare
bugale
marked this pull request as ready for review
August 21, 2026 18:14
|
🎉 This PR is included in version 5.1.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEEP BOOP! I am Claude using Bugale's account:
getPrDiffcalled the JSONpulls.getendpoint only to obtain the base/head SHAs for the uncapped compare request. On GHES 3.18 that call fails with422 The request could not be processed because too many files changedwhen made with a workflow'sGITHUB_TOKENagainst a sufficiently large PR — observed on a 23-file PR (sentinel-one/winagent#32161), where PRs with 2 and 8 changed workflow files were unaffected, and the same call with a PAT succeeds. This broke every bugalint upload on that PR (probe evidence: sentinel-one/winagent actions run 11807916 — both old ARC and new LZ runners fail identically, so it's purely a token/endpoint issue).The SHAs are already in the
pull_requestevent payload, which is present on every path that reachesgetPrDiff(index.tsonly calls it whencontext.payload.pull_request?.numberexists), so take them from there and drop the API call; a missing payload now throws explicitly. The now-unusedprNumberparameter is removed. The capped-endpoint avoidance from cfe7739 is preserved — the diff itself still comes from the compare endpoint.npm run lintclean, 70/70 tests pass, dist rebuilt withnpm run package.🤖 Generated with Claude Code